package com.frank.demo.gc;

import com.frank.demo.util.TimeUtils;

import java.lang.management.ManagementFactory;
import java.nio.ByteBuffer;
import java.util.concurrent.TimeUnit;

public class G1 {

    public static void main(String[] args) throws InterruptedException {

        String name = ManagementFactory.getRuntimeMXBean().getName();
        System.err.println(name);

        TimeUnit.SECONDS.sleep(5);
        for (int i = 0; i < 10000; i++) {
            ByteBuffer.allocate(1024 * 1024 * 2);
            System.out.println("---------------------------------------------");
            TimeUnit.MILLISECONDS.sleep(300);
        }
    }
}
